//
// Created by sjjmw on 3/24/2022.
//

//应该使用dfs

#include "iostream"
#include "vector"
#include "list"
#include "algorithm"
#include "string"
#include "unordered_map"
#include "cmath"
#include<iomanip>
#include "string"
#include "map"
#include "list"
struct Sol{
    std::vector<std::vector<int>> mat;
    int get_sub_sum(int offx,int offy,int w){
        int sum=0;
        for(int i=offx;i<offx+w;i++){
            for (int j = offy; j < offy+w; ++j) {
                sum+=mat[j][i];
            }
        }
        return sum;
    }
    void conv_sub_sum(int offx,int offy,int w){
//        int sum=0;
        for(int i=offx;i<offx+w;i++){
            for (int j = offy; j < offy+w; ++j) {
                mat[j][i]= -mat[j][i];
            }
        }
//        return sum;
    }
    void handle(
            int n
            ){
        std::vector<int> line(n);
        for(int i=0;i<n;i++){
            for (int j = 0; j < n; ++j) {
                std::cin>>line[j];
            }
            mat.push_back(line);
        }
        int sw=(n+1)/2;
        while(1){
            int fx=-1,fy=-1;//找到的最优翻转
//            int min_sum=INT_MAX;
            bool found=false;
            for (int i = 0; i < n-sw+1; ++i) {
                for (int j = 0; j < n-sw+1; ++j) {
                    int subsum=-get_sub_sum(i,j,sw);
                    if(subsum>0){
                        found= true;
                        conv_sub_sum(i,j,sw);
                    }
//                    if(subsum>0&&subsum<min_sum){
//                        min_sum=subsum;
//                        fx=i;fy=j;
//                    }
                }
            }
            if(!found){
                break;
            }
        }
        int sum=0;
        for(int i=0;i<n;i++){
            for (int j = 0; j < n; ++j) {
                sum+=mat[i][j];
            }
        }
        printf("%d\n",sum);
    }
};
int main(){
    int a,b,c;
//    float a,b,c,d;
    int e;
    while(std::cin>>a){
        Sol().handle(a);
    }

    return 0;
}